<?php
namespace Admin\Controller;
use Common\Controller\AdminbaseController;
class AppUserController extends AdminbaseController{
	function _initialize() {
		parent::_initialize();
	}
	
	function index(){
		$userName = I('param.userName');
		$sex = I('param.sex',2);
		if($userName){
			$where = "&userName=$userName"; 
			
		}
		if($sex !== '全部' && $sex!= 2){
			$where .= "&sex=$sex";
				
		}
		$trtotal = $this->curl_http(C('user_admin_url').'user/queryAppUserList?token='.$_SESSION["TOKEN"].'&curPage=1&pageSize=1'.$where);
		$page = $this->page($trtotal['ReturnData']['page']['totalCount'],20);
		$result = $this->curl_http(C('user_admin_url').'user/queryAppUserList?token='.$_SESSION["TOKEN"]."&curPage=".$page->Current_page."&pageSize=".$page->Page_size.$where);
		$this->assign("data", $result['ReturnData']['list']);
		$this->assign("page", $page->show('Admin'));
		$this->display();
	}

	function detail(){
		$userId = I('param.userId', 0);
		$result = $this->curl_http(C('user_admin_url').'user/queryAppUserByUserId?token='.$_SESSION["TOKEN"].'&userId='.$userId);
		//dump($result['ReturnData']);exit;
		$this->assign("data", $result['ReturnData']['appUser']);
		$this->display();
	}

	function cai(){
	    $userId = I('param.userId', 0);
	    $this->assign("userId", $userId);
		$this->display();
	}

	function score(){
	    $userId = I('param.userId', 0);
	    $this->assign("userId", $userId);
		$this->display();
	}
	
}